import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: hp
 * Date: 2024-07-22
 * Time: 10:27
 */
public class Test4 {
    private static volatile int n = 0;

    public static void main(String[] args) {
        Thread t1 = new Thread(() -> {
            while(n == 0) {

            }
            System.out.println("线程结束");
        });

        Thread t2 = new Thread(() -> {
           Scanner scanner = new Scanner(System.in);
           n = scanner.nextInt();
        });
        t1.start();
        t2.start();

    }
}
